﻿using UnityEngine;
using System.Collections;

/// <summary> 可以受到伤害的 接口 </summary>

public interface ICanTakeDamage
{
    /// <param name="attacker"> 主动攻击者 </param>
	void TakeDamage(DamageInfo damage, GameObject attacker = null, bool breakAction = false);
}

[System.Serializable]
public struct DamageInfo
{
    public int damage;
    public DamageType type;


    /// <summary> 由于不能设置无参构造函数。用此社默认值 </summary>  
    public DamageInfo(Object tmp)
    {
        this.damage = 10;
        this.type = DamageType.Normal;
    }

    public DamageInfo(int defaultCtor)
    {
        damage = defaultCtor;
        type = DamageType.Normal;
    }

    public DamageInfo(int damage, DamageType type)
    {
        this.damage = damage;
        this.type = type;
    }

}

/// <summary> 伤害类型 </summary>
public enum DamageType
{
    /// <summary>  普通伤害   </summary>
    Normal,
    /// <summary>  持续（毒液）伤害   </summary>
    Poison,
}